package SQLite3;

import java.util.Vector;

public class TableResult
  implements Callback
{
  public boolean atmaxrows;
  public String[] column;
  public int maxrows = 0;
  public int ncolumns;
  public int nrows;
  public Vector<String[]> rows;
  public String[] types;
  
  public TableResult()
  {
    clear();
  }
  
  public TableResult(int paramInt)
  {
    this.maxrows = paramInt;
    clear();
  }
  
  public void clear()
  {
    this.column = new String[0];
    this.types = null;
    this.rows = new Vector();
    this.nrows = 0;
    this.ncolumns = 0;
    this.atmaxrows = false;
  }
  
  public void columns(String[] paramArrayOfString)
  {
    this.column = paramArrayOfString;
    this.ncolumns = this.column.length;
  }
  
  public boolean newrow(String[] paramArrayOfString)
  {
    boolean bool = true;
    if (paramArrayOfString != null) {
      if ((this.maxrows > 0) && (this.nrows >= this.maxrows)) {
        this.atmaxrows = true;
      }
    }
//    for (;;)
//    {
//      return bool;
//      this.rows.addElement(paramArrayOfString);
//      this.nrows += 1;
//      bool = false;
//    }
    return false;
  }
  
  public String toString()
  {
    StringBuffer localStringBuffer = new StringBuffer();
    int i = 0;
    String str;
    if (i < this.ncolumns)
    {
      if (this.column[i] == null) {}
      for (str = "NULL";; str = this.column[i])
      {
        localStringBuffer.append(str);
        localStringBuffer.append('|');
        i++;
        break;
      }
    }
    localStringBuffer.append('\n');
    for (i = 0; i < this.nrows; i++)
    {
      String[] arrayOfString = (String[])this.rows.elementAt(i);
      int j = 0;
      if (j < this.ncolumns)
      {
        if (arrayOfString[j] == null) {}
        for (str = "NULL";; str = arrayOfString[j])
        {
          localStringBuffer.append(str);
          localStringBuffer.append('|');
          j++;
          break;
        }
      }
      localStringBuffer.append('\n');
    }
    return localStringBuffer.toString();
  }
  
  public void types(String[] paramArrayOfString)
  {
    this.types = paramArrayOfString;
  }
}
